package com.nba.service.impl;

import java.util.List;

import com.nba.bean.Hotspot;
import com.nba.bean.Page;
import com.nba.bean.inherit.HotInherit;
import com.nba.dao.HotDao;
import com.nba.dao.impl.HotDaoImpl;
import com.nba.service.HotService;

public class HotServiceImpl implements HotService {

	HotDao hd = new HotDaoImpl();
	
	@Override
	public List<Hotspot> getHotAll() {
		return hd.selectHotAll();
	}

	@Override
	public Hotspot getHotById(int hotspotId) {
		return hd.selectHotById(hotspotId);
	}

	@Override
	public int addHot(Hotspot hotspot) {
		return hd.insertHot(hotspot);
	}

	@Override
	public int deleteHot(int hotspotId) {
		return hd.deleteHot(hotspotId);
	}

	@Override
	public int updateHot(Hotspot hotspot) {
		return hd.updateHot(hotspot);
	}

	@Override
	public Page<HotInherit> getHotAll(String keyword, int pageNum, int pageSize) {
		List<HotInherit> data = hd.selectHotAll(keyword, pageNum, pageSize);
		int totalRows = hd.selectHotTotal(keyword);
		return new Page<HotInherit>(data, pageNum, pageSize, totalRows);
	}

}
